package com.wu.Backstage.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;



@Configuration
public class ResourceConfigAdapter implements WebMvcConfigurer {

    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //获取文件的真实路径
        String FilePath = System.getProperty("user.dir")+"\\src\\main\\resources\\files\\images\\";
        //static/files/**是对应resource下工程目录
        System.out.println(FilePath);
        registry.addResourceHandler("/images/**").addResourceLocations("file:"+FilePath);
    }



}
